import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class FinanceCustomizedManageService {

  private serviceUrls: any = {
    buyCustomCouponListUrl: '/adzRedPacketInfo/buyCouponsList', // 购买定制券列表
    exportCustomCouponUrl: '/adzRedPacketInfo/findExcel', // 购买定制券导出

    queryAdzSaleAfterListUrl: '/adzOrderRefund/list', // 售后明细列表
    exportAdzSaleAfterUrl: '/adzOrderRefund/getOrderExcel' // 售后明细导出
  };

  constructor(public httpClient: HttpClient) { }

  // 购买定制券List
  buyCustomCouponList(params: any) {
    return this.httpClient.post(this.serviceUrls.buyCustomCouponListUrl, params).toPromise();
  }

  // 购买定制券导出
  exportCustomCouponData(params: any) {
    return this.httpClient.get(this.serviceUrls.exportCustomCouponUrl, { params, responseType: 'blob' }).toPromise();
  }

  // 查询售后明细List
  queryAdzSaleAfterList(params: any) {
    return this.httpClient.post(this.serviceUrls.queryAdzSaleAfterListUrl, params).toPromise();
  }

  // 导出售后明细
  exportAdzSaleAfterData(params: any) {
    return this.httpClient.get(this.serviceUrls.exportAdzSaleAfterUrl, { params, responseType: 'blob' }).toPromise();
  }
}



